import { createRouter, createWebHistory } from 'vue-router'
import type { RouteRecordRaw } from 'vue-router'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    redirect: '/welcome'
  },
  {
    path: '/resume',
    name: 'Resume',
    children: [
      {
        path: 'calculation',
        name: 'Calculation',
        children: [
          {
            path: 'quality-score',
            name: 'QualityScore',
            component: () => import('../views/resume/calculation/QualityScore.vue')
          },
          {
            path: 'batch-quality-score',
            name: 'BatchQualityScore',
            component: () => import('../views/resume/calculation/BatchQualityScore.vue')
          }
        ]
      },
      {
        path: 'query',
        name: 'Query',
        children: [
          {
            path: 'preview-resume',
            name: 'PreviewResume',
            component: () => import('../views/resume/query/PreviewResume.vue')
          },
          {
            path: 'update-purpose',
            name: 'UpdatePurpose',
            component: () => import('../views/resume/query/UpdatePurpose.vue')
          }
        ]
      }
    ]
  },
  {
    path: '/welcome',
    name: 'Welcome',
    component: () => import('../views/Welcome.vue')
  },
  {
    path: '/menu1',
    name: 'Menu1',
    children: [
      {
        path: 'test1',
        name: 'Test1',
        component: () => import('../views/menu1/Test1.vue')
      },
      {
        path: 'test2',
        name: 'Test2',
        component: () => import('../views/menu1/Test2.vue')
      }
    ]
  },
  {
    path: '/menu2',
    name: 'Menu2',
    children: [
      {
        path: 'test3',
        name: 'Test3',
        component: () => import('../views/menu2/Test3.vue')
      },
      {
        path: 'menu3',
        name: 'Menu3',
        children: [
          {
            path: 'test4',
            name: 'Test4',
            component: () => import('../views/menu2/menu3/Test4.vue')
          },
          {
            path: 'test5',
            name: 'Test5',
            component: () => import('../views/menu2/menu3/Test5.vue')
          }
        ]
      }
    ]
  },
  {
    path: '/help',
    name: 'Help',
    component: () => import('../views/Help.vue')
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router